function [ mpc ] = mpc_dualInt_soft_param( sys, x, u, k, param )
ref=param.ref;
mpc=InitMPC(sys,param.Q*eye(2),param.R*eye(2),param.H*eye(2));
nSample=20;

len=length(ref);
if((2*k+2*nSample)<=len)
    ref=ref(2*k-1:2*k+2*nSample-2);
else
    if(2*k<len)
        ref=ref(2*k-1:end);
    else
        ref=ref(1:2*nSample);
        ref(1:2*nSample)=0;
    end
    ref(2*nSample)=0;
end

ref=ref';

mpc=MPCSampling(mpc,nSample,param.Tvz,blockMatrix(sys,param.Tvz,param.Block));
mpc=MPCHardBounds(mpc,createBounds(sys,param.Tvz,param.hard_lb,[],-1),createBounds(sys,param.Tvz,param.hard_ub,[],1));
mpc=MPCSoftBounds(mpc,ref+createBounds(sys,nSample,param.soft_lb,[],-1),ref+createBounds(sys,nSample,param.soft_ub,[],1),param.wApply);
mpc=addMPCstate(mpc,x);
mpc=addMPCcontrol(mpc,u);
mpc=addMPCref(mpc,ref);
end

